package com.example.hrmspractice.controller;

import com.example.hrmspractice.domain.ApiResponse;
import com.example.hrmspractice.domain.Employee;
import com.example.hrmspractice.service.impl.EmployeeServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/employee")
@RequiredArgsConstructor
public class EmployeeController {
    private final EmployeeServiceImpl employeeService;

    @PostMapping
    public ApiResponse add(@RequestBody Employee employee){
        return employeeService.add(employee);
    }
    @PutMapping
    public ApiResponse update(@RequestBody Employee employee){
        return employeeService.update(employee);
    }

}
